package com.yx.china.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.yx.china.project.entities.Payment;
import com.yx.china.project.entities.ResponseResult;
import com.yx.china.service.PayService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@Slf4j
public class ConsumerController {
    @Resource
    private PayService payService;

    @GetMapping("/consumer/pay/{id}")
    public ResponseResult<Payment> paymentSQL(@PathVariable("id") Integer id){
        ResponseResult<Payment> result =payService.paymentSQL(id);
        return result;
    }

}
